package com.zy.cat.entity.dev;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Index;
import javax.persistence.Table;

import com.zy.cat.entity.primary.CatDevReRedHistoryPrimary;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @info 返现红包历史记录，不参与计算总金额
 * @author Link
 * @date 2019-11-26 14:44
 */
@Entity
@Table(name = "zy_cat_user_rered_data", indexes = {
		@Index(name = "pid", columnList = "pid"),
		@Index(name = "fstatus", columnList = "fstatus"), 
		@Index(name = "ctime", columnList = "ctime") })
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("返现红包历史记录，不参与计算总金额")
public class CatDevReRedHistory {
	
	@Id
	@Column(columnDefinition = "CHAR(32) NOT NULL  COMMENT '主键ID'")
	@ApiModelProperty(value = "主键ID", example = "c9adb120ca2b48f88626ebd35000fa08")
	private String rid=UUID.randomUUID().toString().replace("-", "");

	@Column(columnDefinition = "CHAR(32) NOT NULL COMMENT '账号ID【返现红包历史记录，不参与计算总金额】'")
	@ApiModelProperty(value = "账号ID", example = "3d6a4fa29641")
	private String pid;
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '创建时间'")
	@ApiModelProperty(value = "创建时间", example = "2019-02-22 12:56:56")
	private String ctime;
	
	@Column(columnDefinition = "INT(1) DEFAULT '1' COMMENT '使用状态（0.未使用、1.已使用、2.已过期）'")
	@ApiModelProperty(value = "使用状态（0.未使用、1.已使用、2.已过期）", example = "1")
	private int fstatus;
	
	@Column(name = "ptype", columnDefinition = "INT(1) DEFAULT '1' COMMENT '红包类型（0.3元无门槛、1.下单返现红包、2.15元补贴红包）'")
	@ApiModelProperty(value = "红包类型（0.3元无门槛、1.下单返现红包、2.15元补贴红包）", example = "1")
	private int ptype;

	@Column(columnDefinition = "BIGINT(20) DEFAULT '0' COMMENT '奖励（分）'")
	@ApiModelProperty(value = "奖励（分）", example = "300")
	private long income;
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '最后更新时间'")
	@ApiModelProperty(value = "最后更新时间", example = "2019-02-22 12:56:56")
	private String ltime;

	@Column(columnDefinition = "VARCHAR(200) DEFAULT '-' COMMENT '备注'")
	@ApiModelProperty(value = "备注", example = "备注")
	private String info = "-";

	public CatDevReRedHistory(String pid, String ctime, int fstatus,int ptype, long income, String ltime) {
		super();
		this.pid = pid;
		this.ctime = ctime;
		this.fstatus = fstatus;
		this.ptype=ptype;
		this.income = income;
		this.ltime = ltime;
	}

	public CatDevReRedHistory(String pid, int fstatus) {
		super();
		this.pid = pid;
		this.fstatus = fstatus;
	}
}
